Quaqua 3.9.5 2007-10-21

ch.randelshofer.quaqua
Class QuaquaManager

java.lang.Object
  extended by ch.randelshofer.quaqua.QuaquaManager

public class QuaquaManager
extends java.lang.Object

The QuaquaManager provides bug fixes and enhancements for the Mac Look and Feel and for the Aqua Look and Feel on Mac OS X.

Usage for Java Applications:

 UIManager.setLookAndFeel(QuaquaManager.getLookAndFeelClassName());
 

Usage for Java Applets:

 UIManager.put("ClassLoader", getClass().getClassLoader());
 UIManager.setLookAndFeel(QuaquaManager.getLookAndFeel());
 

System Properties for Java Applications:
You can customize the Quaqua Look and Feel using the following system properties:

Example:
 System.setProperty("Quaqua.design", "panther");
 System.setProperty("Quaqua.TabbedPane.design", "jaguar");
 System.setProperty("Quaqua.FileChooser.autovalidate", "true");
 

System Properties for Java Applets:
In a secure environment, you are not allowed to change system properties. Use QuaquaManager.setProperty to specify (or override) system properties that are used by Quaqua (that is, for all system properties listed above).

Example:

 QuaquaManager.setProperty("Quaqua.design", "panther");
 QuaquaManager.setProperty("Quaqua.TabbedPane.design", "jaguar");
 QuaquaManager.setProperty("Quaqua.FileChooser.autovalidate", "true");
 

Client Properties:
You can customize some of the components by specifying client properties.

Specifying class loader (Java Applets):
If your code runs as an Applet in a Java 1.3 VM, Swing attempts to load the UI classes from the system class loader instead of from the class loader which loads the applet classes. To have Swing load the UI classes using the same class loader as your code, use the following code to set the Quaqua look and feel on Swing's UIManager.
 UIManager.put("ClassLoader", getClass().getClassLoader());
 UIManager.setLookAndFeel(QuaquaManager.getLookAndFeel());
 

Version:
2.2 2006-03-12 Method getVersion added.
2.1.2 2006-02-13 Print warning message, when file "laf.txt" is missing.
2.1.1 2005-12-09 Reorganized some packages and class names.
2.1 2005-12-01 Method getLookAndFellClassName does not use UIManager.getDefaultLookAndFeel anymore to decide which Quaqua look and feel implementation to use.
2.0 2005-09-10 Read L&F class names from file laf.txt. Moved FileSystemView related methods out into class QuaquaFileSystemView. Added method getOS(), and made OS Constants public.
1.8.3 2005-08-03 Fall back to FileSystemView.getFileSystemView when creating one of the Quaqua FileSystemView's fails.
1.8.2 2005-06-20 Fixed bug in code that determines the OS.
1.8.1 2005-06-19 OS and Design property are now updated each time when a look and feel class name is requested.
1.8 2005-05-29 Added method getProperty(String, int[]). Fixed missing break statement which caused that Quaqua13PantherLookAndFeel was never used.
1.7 2005-05-16 System Property "Quaqua.Debug.crossPlatform" added.
1.6 2005-05-15 Support for Mac OS X 10.4 Tiger added.
1.5 2005-05-08 Method boolean get(String) added.
1.4.1 2004-10-31 The file system view must be chosen on the OS in use, and not on the Quaqua design in use.
1.4 2004-09-10 Catched security exception caused by static initializer. Method setProperty, getProperty and removeProperty added.
1.3 2004-06-30 Revised.
1.2.2 2004-02-06 Support for Java 1.4.2 added.
1.2.1 2003-10-29 Support for Mac OS X 10.3 added.
1.2 2003-09-28 Method getLookAndFeel added.
1.1 2003-09-11 Workarounds for Java 1.4.1 Update 1 added.
1.0 2003-07-20 Created.
Author:
Werner Randelshofer

Field Summary
static int CHEETAH
          Mac OS X 10.0 Cheetah.
static int JAGUAR
          Mac OS X 10.2 Jaguar.
static int PANTHER
          Mac OS X 10.3 Panther.
static int PUMA
          Mac OS X 10.1 Puma.
static int TIGER
          Mac OS X 10.4 Tiger.
static int UNKNOWN
          Unknown.
static int WINDOWS
          Windows.
 
Method Summary
static boolean getBoolean(java.lang.String key)
          This method returns a boolean UIManager property.
static int getDesign()
          Returns the current design of Mac OS X.
static javax.swing.LookAndFeel getLookAndFeel()
          Returns a Quaqua look and feel, if workarounds for the system look and feel are available.
static java.lang.String getLookAndFeelClassName()
          Returns the class name of a Quaqua look and feel.
static int getOS()
          Returns the current operating system.
static java.lang.String getProperty(java.lang.String key)
          This method returns a locally specified property, if it has been set using method setProperty.
static int[] getProperty(java.lang.String key, int[] def)
          This method returns a locally specified property, if it has been set using method setProperty.
static java.lang.String getProperty(java.lang.String key, java.lang.String def)
          This method returns a locally specified property, if it has been set using method setProperty.
static java.lang.String getVersion()
          Returns the version string of Quaqua.
static boolean isNativeCodeAvailable()
          Returns true, if Quaqua uses native code for some of its functionality.
static boolean isOSX()
          Returns true if the current operating system is know to be a Mac OS X.
static void main(java.lang.String[] args)
           
static void removeProperty(java.lang.String key)
          Removes a locally defined property.
static java.lang.String setProperty(java.lang.String key, java.lang.String value)
          Locally defines a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHEETAH

public static final int CHEETAH
Mac OS X 10.0 Cheetah.

See Also:
Constant Field Values

PUMA

public static final int PUMA
Mac OS X 10.1 Puma.

See Also:
Constant Field Values

JAGUAR

public static final int JAGUAR
Mac OS X 10.2 Jaguar.

See Also:
Constant Field Values

PANTHER

public static final int PANTHER
Mac OS X 10.3 Panther.

See Also:
Constant Field Values

TIGER

public static final int TIGER
Mac OS X 10.4 Tiger.

See Also:
Constant Field Values

WINDOWS

public static final int WINDOWS
Windows.

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Unknown.

See Also:
Constant Field Values
Method Detail

getOS

public static int getOS()
Returns the current operating system.

Returns:
one of the OS constants: CHEETAH..TIGER, WINDOWS or UNKNOWN.

isOSX

public static boolean isOSX()
Returns true if the current operating system is know to be a Mac OS X.


getDesign

public static int getDesign()
Returns the current design of Mac OS X.

Returns:
one of the OS constants: CHEETAH..TIGER or UNKNOWN.

getLookAndFeelClassName

public static java.lang.String getLookAndFeelClassName()
Returns the class name of a Quaqua look and feel. The class name depends on the JVM, Quaqua is running on, and on the visual design of the operating system.


getLookAndFeel

public static javax.swing.LookAndFeel getLookAndFeel()
Returns a Quaqua look and feel, if workarounds for the system look and feel are available. Returns a UIManager.getSystemLookAndFeelClassName() instance if no workaround is available.


getBoolean

public static boolean getBoolean(java.lang.String key)
This method returns a boolean UIManager property. This method has been moved here, because Java 1.3 does not support this directly.


getProperty

public static java.lang.String getProperty(java.lang.String key)
This method returns a locally specified property, if it has been set using method setProperty. If no local property has been found, a system property using method java.lang.System.getProperty(String,String is returned.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
setProperty(java.lang.String, java.lang.String)

getProperty

public static java.lang.String getProperty(java.lang.String key,
                                           java.lang.String def)
This method returns a locally specified property, if it has been set using method setProperty. If no local property has been found, a system property using method java.lang.System.getProperty(String,String is returned.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
setProperty(java.lang.String, java.lang.String)

getProperty

public static int[] getProperty(java.lang.String key,
                                int[] def)
This method returns a locally specified property, if it has been set using method setProperty. If no local property has been found, a system property using method java.lang.System.getProperty(String,String is returned.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
setProperty(java.lang.String, java.lang.String)

setProperty

public static java.lang.String setProperty(java.lang.String key,
                                           java.lang.String value)
Locally defines a property.

Use method clearProperty to clear a local property.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
getProperty(java.lang.String)

removeProperty

public static void removeProperty(java.lang.String key)
Removes a locally defined property.

This method is used to specify properties for Quaqua, when, due to security reasons, system properties can not be used, e.g. in a secure Applet environment.

See Also:
setProperty(java.lang.String, java.lang.String)

getVersion

public static java.lang.String getVersion()
Returns the version string of Quaqua. The version string is a sequence of numbers separated by full stops, followed by a blank character and a release date in ISO-format. e.g. "3.6.1 2006-03-12"


main

public static void main(java.lang.String[] args)

isNativeCodeAvailable

public static boolean isNativeCodeAvailable()
Returns true, if Quaqua uses native code for some of its functionality.


Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.